package com.ruihu.admin.util.excel;


import com.ruihu.admin.util.FileUtil;

import java.io.*;

public class RHExcelReader {

    public static RHExcel openExcel(String filePath) throws IOException {
        FileUtil.isFileExistThrowException(filePath);
        return new RHExcel(new File(filePath).getCanonicalPath());
    }

    public static RHExcel openExcel(File file) throws IOException {
        return new RHExcel(file.getCanonicalPath());
    }

    public static RHExcel openExcel(InputStream ins, RHExcelFileType fileType) throws IOException {
        return new RHExcel(ins, fileType);
    }

    public static void main(String[] args) throws Exception {
        RHExcel excel = openExcel(new FileInputStream(new File("F:/privilege.xlsx")), RHExcelFileType.XLSX);
        System.out.println(excel.getSheetList());
    }

}
